package com.song.osclient.http;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.PersistentCookieStore;

/**
 * Created by song on 2015/7/29.
 */
public class Http {
    private final static AsyncHttpClient httpClient = new AsyncHttpClient();
    private final static String HOST;
    public final static int TIMEOUT = 20 * 3;

    static {
        HOST = "http://211.138.17.55:20000/rnms";
        httpClient.setTimeout(TIMEOUT * 1000);
    }

    public static void setCookieStore(PersistentCookieStore cookieStore) {
        httpClient.setCookieStore(cookieStore);
    }

    public static String getAbsoluteUrl(String relativeUrl) {
        return HOST + relativeUrl;
    }

    public static AsyncHttpClient getHttpClient() {
        return httpClient;
    }
}
